﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Microsoft.EntityFrameworkCore;

namespace WCS.Infrastructure.EFCore;

/// <summary>
/// 优惠券包领取记录表
/// </summary>
[Table("CouponPackageReceiveRecord")]
public partial class CouponPackageReceiveRecord
{
    /// <summary>
    /// 记录ID
    /// </summary>
    [Key]
    [StringLength(32)]
    public string Id { get; set; } = null!;

    /// <summary>
    /// 关联优惠券包ID
    /// </summary>
    [StringLength(32)]
    public string PackageId { get; set; } = null!;

    /// <summary>
    /// 领取用户ID
    /// </summary>
    [StringLength(32)]
    public string UserId { get; set; } = null!;

    /// <summary>
    /// 领取渠道：1=线下扫码，2=线上推荐（小程序），3=活动页面
    /// </summary>
    public int ReceiveChannel { get; set; }

    /// <summary>
    /// 领取凭证（如扫码的凭证码）
    /// </summary>
    [StringLength(32)]
    public string? ReceiveCode { get; set; }

    /// <summary>
    /// 领取设备信息（如手机型号）
    /// </summary>
    [StringLength(255)]
    public string? DeviceInfo { get; set; }

    /// <summary>
    /// 领取IP地址
    /// </summary>
    [Column("IPAddress")]
    [StringLength(45)]
    public string? Ipaddress { get; set; }

    /// <summary>
    /// 扩展属性
    /// </summary>
    public string? ExtraProperties { get; set; }

    /// <summary>
    /// 创建时间
    /// </summary>
    [Column(TypeName = "timestamp(6) without time zone")]
    public DateTime CreationTime { get; set; }
}
